<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <title>登录后台</title>
    <link href="__CSS__/style.css" rel="stylesheet">
    <link href="__CSS__/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="__JS__/html5shiv.js"></script>
    <script src="__JS__/respond.min.js"></script>
    <![endif]-->

    <!--jquery slider start-->
    <script src="__JS__/jquery-1.10.2.min.js"></script>
    <link href="__JS__/jquery_slider/css/jquery.slideBox.css" rel="stylesheet" type="text/css" />
    <script src="__JS__/jquery_slider/js/jquery.slideBox.js" type="text/javascript"></script>
    <!--jquery slider end-->
</head>

<script>
    var content;
    $(function () {
        content = $("#slideBox").html();
        $("#slideBox").slideBox();
        $(window).resize(function() {
            var width = $(window).width();
            $("#slideBox").width(width/2);
            $("#slideBox").html(content);
            $("#slideBox").slideBox();
        })
    });


</script>

<body class="login-body">

<div class="container" style="margin-top: 100px; width:100%;">
    <!--轮播开始-->
    <div id="slideBox" class="slideBox" style="float: left;margin-left:5%; ">
        <ul class="items" id="items">
            <foreach name="adlist" item="vo">
            <li><a href="{:U('Shopadmin/Login/ad_detail',array('id'=>$vo['id']))}" title="{$vo.title}"><img src="{$vo.img}" style="width: 100%; min-height: 500px" ></a></li>
            </foreach>
        </ul>
    </div>
    <!--轮播结束-->
    <form id="login-form" class="form-signin" method="post" style="float: right;margin-right:10%;">
        <div class="form-signin-heading text-center">
            <img src="__IMG__/login-logo.png"  width="100"/>
        </div>
        <div class="login-wrap">
            <input id="account" type="text" class="form-control" placeholder="账号" autofocus>
            <input id="password" type="password" class="form-control" placeholder="密码">

            <button class="btn btn-lg btn-login btn-block" type="submit">
                <i class="fa fa-check"></i>
            </button>
        </div>
    </form>

</div>

<!-- Placed js at the end of the document so the pages load faster -->

<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/modernizr.min.js"></script>
<script src="__JS__/common.js"></script>
<script type="text/javascript">
    $(function(){
        $("#login-form").submit(function(){
            var account = $("#account").val();
            var password = $("#password").val();
            if(account == ""){
                $("#account").focus();
                return false;
            }
            if(password == ""){
                $("#password").focus();
                return false;
            }
            var url = "{:U('/Shopadmin/Login/index')}";
            $.post(url, {account:account, password:password}, function(res){
               if(res.success){
                   toast(res.msg, true);
                       window.location.href = "{:U('/Shopadmin/Code/Code_list')}";
               }else{
                   toast(res.msg, false);
               }
            });
            return false;
        });
    })
</script>
</body>
</html>
